Was there severe flooding related to the storm? For locations along the storm path, try to figure out:
What areas were along the storm path?
BG: For this, you’ll need to have the storm track for each storm. I guess then match with distance to lat-lon coordinates for city or county centers to identify locations near the storm track?
The rnoaa package has some functions to tap into the IBTracS dataset, which has tropical storm tracks. It looks like you might be able to use the storm_data function to pull in data on a storm. You can pull for just one storm if you have the storm serial number, but it’s not entirely clear to me how you would figure out what this number is for a storm you want to look for.
You can pull by year or basin, but it looks like you can’t pull by both at the same time. I’ll put just for 1992:
# install_github("ropenscilabs/rnoaa") # if you need to install the package
library(rnoaa)
hurrs_1992 <- storm_data(year = 1992)
## <path>~/.rnoaa/storms/year/Year.1992.ibtracs_all.v03r06.csv
It looks like that pulls a list object, with the element data that has the actual data:
names(hurrs_1992)
## [1] "data"
colnames(hurrs_1992$data)[1:10]
## [1] "serial_num" "season" "num" "basin" "sub_basin"
## [6] "name" "iso_time" "nature" "latitude" "longitude"
Maybe we could use the name column to look for Andrew?
andrew <- hurrs_1992$data[which(hurrs_1992$data$name == "ANDREW"), ]
andrew[1:5, 1:10]
## serial_num season num basin sub_basin name iso_time
## 2417 1992230N11325 1992 4 NA MM ANDREW 1992-08-16 18:00:00
## 2418 1992230N11325 1992 4 NA MM ANDREW 1992-08-17 00:00:00
## 2419 1992230N11325 1992 4 NA MM ANDREW 1992-08-17 06:00:00
## 2420 1992230N11325 1992 4 NA MM ANDREW 1992-08-17 12:00:00
## 2421 1992230N11325 1992 4 NA MM ANDREW 1992-08-17 18:00:00
## nature latitude longitude
## 2417 TS 10.8 -35.5
## 2418 TS 11.2 -37.4
## 2419 TS 11.7 -39.6
## 2420 TS 12.3 -42.0
## 2421 TS 13.1 -44.2
This looks about right…
Note: after digging some more, it looks like you can use the storm_meta function with the argument what = "storm_names" from storm_data to get the serial number for a storm if you know its name:
storm_names <- storm_meta(what = "storm_names")
head(storm_names, 3)
## id name
## 1 1842298N11080 NOT NAMED(td9636)
## 2 1845336N10074 NOT NAMED(td9636)
## 3 1848011S09079 NOT NAMED(td9636)
grep("ANDREW", storm_names$name, value = TRUE)
## [1] "ANDREW(hurdat_atl) - bal011986(atcf)"
## [2] "ANDREW(hurdat_atl) - bal041992(atcf)"
storm_names[grep("ANDREW", storm_names$name), ]
## id name
## 9276 1986156N26284 ANDREW(hurdat_atl) - bal011986(atcf)
## 9963 1992230N11325 ANDREW(hurdat_atl) - bal041992(atcf)
andrew_id <- storm_names[grep("ANDREW", storm_names$name), 1][2]
andrew_2 <- storm_data(storm = andrew_id)
## <path>~/.rnoaa/storms/storm/Storm.1992230N11325.ibtracs_all.v03r06.csv
head(andrew_2$data[ , c("iso_time", "latitude", "longitude", "wind.wmo.")], 3)
## iso_time latitude longitude wind.wmo.
## 1 1992-08-16 18:00:00 10.8 -35.5 25
## 2 1992-08-17 00:00:00 11.2 -37.4 30
## 3 1992-08-17 06:00:00 11.7 -39.6 30
Let’s see what happens if we plot the locations of this:
andrew_loc <- select(andrew, iso_time, latitude, longitude, wind.wmo.)
head(andrew_loc, 3)
## iso_time latitude longitude wind.wmo.
## 2417 1992-08-16 18:00:00 10.8 -35.5 25
## 2418 1992-08-17 00:00:00 11.2 -37.4 30
## 2419 1992-08-17 06:00:00 11.7 -39.6 30
ggplot(andrew_loc, aes(x = longitude, y = latitude)) +
geom_path() + geom_point(aes(color = wind.wmo.))

Let me add to a map:
library(ggmap)
miami_map <- get_map(location = 'Miami', zoom = 3)
ggmap(miami_map) +
geom_path(data = andrew_loc, aes(x = longitude, y = latitude)) +
geom_point(data = andrew_loc, aes(x = longitude, y = latitude,
color = wind.wmo.))

And more locally:
miami_map <- get_map(location = 'Miami', zoom = 5)
ggmap(miami_map) +
geom_path(data = andrew_loc, aes(x = longitude, y = latitude)) +
geom_point(data = andrew_loc, aes(x = longitude, y = latitude,
color = wind.wmo.))

Next, we could measure distance from US county centers and pick out the counties that were within [x] kilometers of the 6-hour storm location measures.
Cyclone Tracy example: (note: need to pull from 1975, even though it was in 1974)
Tracy_1975<-storm_data(year=1975)
## <path>~/.rnoaa/storms/year/Year.1975.ibtracs_all.v03r06.csv
names(Tracy_1975)
## [1] "data"
colnames(Tracy_1975$data)[1:10]
## [1] "serial_num" "season" "num" "basin" "sub_basin"
## [6] "name" "iso_time" "nature" "latitude" "longitude"
tracy <- Tracy_1975$data[which(Tracy_1975$data$name == "07S:TRACY"), ]
as.vector(unique(Tracy_1975$data$name))
## [1] "MARCIA" "NORAH"
## [3] "PENNY" "01P"
## [5] "02P:HSK0475" "03S:SELMA"
## [7] "04P:HSK0675" "05P:HSK0775"
## [9] "06P:HSK0875" "07S:TRACY"
## [11] "ADELE" "08S"
## [13] "09S:BLANDINE" "01B"
## [15] "10S:CAMILLE" "12P"
## [17] "11P:12P:FLORA" "14S:DEBORAH:ROBYN:ROBYN/DEBORA"
## [19] "13P" "13P:GLORIA"
## [21] "LOLA" "15P:HSK1675"
## [23] "NOT NAMED" "16P:VAL"
## [25] "17S" "ELSA"
## [27] "18P:HSK1975" "19S"
## [29] "FERNANDE" "20S:GERVAISE"
## [31] "SHIRLEY" "21S:TRIXIE"
## [33] "22S:HELOSE" "23P:ALISON"
## [35] "24S:26S:INES" "25S:WILMA"
## [37] "26S" "27S:VIDA"
## [39] "28S:BEVERLEY" "29P:BETTY:HSK3075"
## [41] "30P:AMELIA" "31S:JUNON"
## [43] "CLARA" "32S:CLARA"
## [45] "02W:TD 02" "02A"
## [47] "03B" "DENISE"
## [49] "04A" "AGATHA"
## [51] "05B" "TD0616"
## [53] "06B" "07A"
## [55] "UNNAMED" "08B"
## [57] "AMY" "BRIDGET"
## [59] "CARLOTTA" "ELEANOR"
## [61] "09B" "MAMIE"
## [63] "BLANCHE" "FRANCENE"
## [65] "NINA" "10B"
## [67] "05W:TD 05" "(NAMELESS)(-)1:RITA:TD0809"
## [69] "ORA" "PHYLLIS"
## [71] "GEORGETTE" "HILARY"
## [73] "11B" "RITA"
## [75] "ILSA" "JEWEL"
## [77] "CAROLINE" "SUSAN"
## [79] "KATRINA" "DORIS"
## [81] "TESS" "VIOLA"
## [83] "WINNIE" "12B"
## [85] "ELOISE" "ALICE"
## [87] "BETTY" "LILY"
## [89] "FAYE" "GLADYS"
## [91] "13B" "MONICA"
## [93] "NANETTE" "CORA"
## [95] "14A" "ELSIE"
## [97] "18W:FLOSSIE:TD 18" "15B"
## [99] "16A" "OLIVIA"
## [101] "GRACE" "HALLIE"
## [103] "17B" "HELEN:HELLEN"
## [105] "18B" "PRISCILLA"
## [107] "IDA" "19B"
## [109] "JUNE" "20B"
## [111] "SUBTROP:UNNAMED" "25W:TD 25:TD1226"
## [113] "24W:TD 24"
tracy[1:5, 1:10]
## serial_num season num basin sub_basin name iso_time
## 346 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-21 11:30:00
## 347 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-21 12:00:00
## 348 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-21 18:00:00
## 349 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-21 23:30:00
## 350 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-22 00:00:00
## nature latitude longitude
## 346 NR -9.2 132.1
## 347 TS -999.0 -999.0
## 348 NR -9.6 131.5
## 349 NR -9.9 131.2
## 350 TS -999.0 -999.0
storm_names <- storm_meta(what = "storm_names")
head(storm_names)
## id name
## 1 1842298N11080 NOT NAMED(td9636)
## 2 1845336N10074 NOT NAMED(td9636)
## 3 1848011S09079 NOT NAMED(td9636)
## 4 1848011S09080 XXXX848003(reunion)
## 5 1848011S15057 XXXX848002(reunion)
## 6 1848011S16057 NOT NAMED(td9636)
grep("TRACY", storm_names$name, value = TRUE)
## [1] "bsh071975(jtwc_sh) - TRACY(bom) - NOT NAMED(td9636) - TRACY(neumann) - TRACY(ds824_au) - 07S(ds824_sh)"
storm_names[grep("TRACY", storm_names$name), ]
## id
## 7945 1974356S09132
## name
## 7945 bsh071975(jtwc_sh) - TRACY(bom) - NOT NAMED(td9636) - TRACY(neumann) - TRACY(ds824_au) - 07S(ds824_sh)
tracy_id <- storm_names[grep("TRACY", storm_names$name), 1][1]
tracy_2 <- storm_data(storm = tracy_id)
## <path>~/.rnoaa/storms/storm/Storm.1974356S09132.ibtracs_all.v03r06.csv
head(tracy_2$data[ , c("iso_time", "latitude", "longitude", "wind.wmo.")], 3)
## iso_time latitude longitude wind.wmo.
## 1 1974-12-21 11:30:00 -9.2 132.1 -1
## 2 1974-12-21 12:00:00 -999.0 -999.0 -999
## 3 1974-12-21 18:00:00 -9.6 131.5 -1
tracy_loc <- select(tracy, iso_time, latitude, longitude, wind.wmo.)
tracy_loc$latitude[tracy_loc$latitude < -300]<-NA
tracy_loc$longitude[tracy_loc$longitude < -300]<-NA
tracy_loc$wind.wmo.[tracy_loc$wind.wmo. < -300]<-NA
head(tracy, 3)
## serial_num season num basin sub_basin name iso_time
## 346 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-21 11:30:00
## 347 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-21 12:00:00
## 348 1974356S09132 1975 5 SI WA 07S:TRACY 1974-12-21 18:00:00
## nature latitude longitude wind.wmo. pres.wmo. center
## 346 NR -9.2 132.1 -1 990 bom
## 347 TS -999.0 -999.0 -999 -999 N/A
## 348 NR -9.6 131.5 -1 990 bom
## wind.wmo..percentile pres.wmo..percentile track_type
## 346 -100 50.387 main
## 347 -999 -999.000 main
## 348 -100 50.387 main
## latitude_for_mapping longitude_for_mapping current.basin
## 346 -9.20 132.10 SI
## 347 -9.33 132.03 SI
## 348 -9.65 131.43 SI
## hurdat_atl_lat hurdat_atl_lon hurdat_atl_grade hurdat_atl_wind
## 346 -999 -999 -999 -999
## 347 -999 -999 -999 -999
## 348 -999 -999 -999 -999
## hurdat_atl_pres td9636_lat td9636_lon td9636_grade td9636_wind
## 346 -999 -999.0 -999.0 -999 -999
## 347 -999 -9.4 132.0 -999 10
## 348 -999 -9.7 131.4 -999 10
## td9636_pres reunion_lat reunion_lon reunion_grade reunion_wind
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## reunion_pres atcf_lat atcf_lon atcf_grade atcf_wind atcf_pres
## 346 -999 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999 -999
## ds824_sh_lat ds824_sh_lon ds824_sh_grade ds824_sh_wind ds824_sh_pres
## 346 -999.0 -999.0 -999 -999 -999
## 347 -9.4 132.0 -999 10 -999
## 348 -9.7 131.3 -999 25 -999
## ds824_ni_lat ds824_ni_lon ds824_ni_grade ds824_ni_wind ds824_ni_pres
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## bom_lat bom_lon bom_grade bom_wind bom_pres ds824_au_lat ds824_au_lon
## 346 -999.0 -999.0 -999 -999 -999 -999.0 -999.0
## 347 -9.2 132.0 -999 -999 990 -9.2 132.1
## 348 -9.6 131.5 -999 -999 990 -9.6 131.5
## ds824_au_grade ds824_au_wind ds824_au_pres jtwc_sh_lat jtwc_sh_lon
## 346 -999 -999 -999 -999.0 -999.0
## 347 -999 45 990 -9.4 132.0
## 348 -999 45 990 -9.7 131.3
## jtwc_sh_grade jtwc_sh_wind jtwc_sh_pres jtwc_wp_lat jtwc_wp_lon
## 346 -999 -999 -999 -999 -999
## 347 -999 10 -999 -999 -999
## 348 -999 25 -999 -999 -999
## jtwc_wp_grade jtwc_wp_wind jtwc_wp_pres td9635_lat td9635_lon
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## td9635_grade td9635_wind td9635_pres ds824_wp_lat ds824_wp_lon
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## ds824_wp_grade ds824_wp_wind ds824_wp_pres jtwc_io_lat jtwc_io_lon
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## jtwc_io_grade jtwc_io_wind jtwc_io_pres cma_lat cma_lon cma_grade
## 346 -999 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999 -999
## cma_wind cma_pres hurdat_epa_lat hurdat_epa_lon hurdat_epa_grade
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## hurdat_epa_wind hurdat_epa_pres jtwc_ep_lat jtwc_ep_lon jtwc_ep_grade
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## jtwc_ep_wind jtwc_ep_pres ds824_ep_lat ds824_ep_lon ds824_ep_grade
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## ds824_ep_wind ds824_ep_pres jtwc_cp_lat jtwc_cp_lon jtwc_cp_grade
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## jtwc_cp_wind jtwc_cp_pres tokyo_lat tokyo_lon tokyo_grade tokyo_wind
## 346 -999 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999 -999
## tokyo_pres neumann_lat neumann_lon neumann_grade neumann_wind
## 346 -999 -999.0 -999.0 -999 -999
## 347 -999 -999.0 -999.0 -999 -999
## 348 -999 -9.5 131.8 -999 45
## neumann_pres hko_lat hko_lon hko_grade hko_wind hko_pres cphc_lat
## 346 -999 -999 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999 -999 -999
## 348 990 -999 -999 -999 -999 -999 -999
## cphc_lon cphc_grade cphc_wind cphc_pres wellington_lat wellington_lon
## 346 -999 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999 -999
## wellington_grade wellington_wind wellington_pres newdelhi_lat
## 346 -999 -999 -999 -999
## 347 -999 -999 -999 -999
## 348 -999 -999 -999 -999
## newdelhi_lon newdelhi_grade newdelhi_wind newdelhi_pres nadi_lat
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## nadi_lon nadi_grade nadi_wind nadi_pres reunion_rmw
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## reunion_wind_radii_1_ne reunion_wind_radii_1_se
## 346 -999 -999
## 347 -999 -999
## 348 -999 -999
## reunion_wind_radii_1_sw reunion_wind_radii_1_nw
## 346 -999 -999
## 347 -999 -999
## 348 -999 -999
## reunion_wind_radii_2_ne reunion_wind_radii_2_se
## 346 -999 -999
## 347 -999 -999
## 348 -999 -999
## reunion_wind_radii_2_sw reunion_wind_radii_2_nw bom_mn_hurr_xtnt
## 346 -999 -999 -999
## 347 -999 -999 -999
## 348 -999 -999 -999
## bom_mn_gale_xtnt bom_mn_eye_diam bom_roci atcf_rmw atcf_poci atcf_roci
## 346 -999 -999 -999 -999 -999 -999
## 347 -999 -999 -1 -999 -999 -999
## 348 -999 -999 -1 -999 -999 -999
## atcf_eye atcf_wrad34_rad1 atcf_wrad34_rad2 atcf_wrad34_rad3
## 346 -999 -999 -999 -999
## 347 -999 -999 -999 -999
## 348 -999 -999 -999 -999
## atcf_wrad34_rad4 atcf_wrad50_rad1 atcf_wrad50_rad2 atcf_wrad50_rad3
## 346 -999 -999 -999 -999
## 347 -999 -999 -999 -999
## 348 -999 -999 -999 -999
## atcf_wrad50_rad4 atcf_wrad64_rad1 atcf_wrad64_rad2 atcf_wrad64_rad3
## 346 -999 -999 -999 -999
## 347 -999 -999 -999 -999
## 348 -999 -999 -999 -999
## atcf_wrad64_rad4 tokyo_dir50 tokyo_long50 tokyo_short50 tokyo_dir30
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 -999 -999 -999
## 348 -999 -999 -999 -999 -999
## tokyo_long30 tokyo_short30 jtwc_.._rmw jtwc_.._poci jtwc_.._roci
## 346 -999 -999 -999 -999 -999
## 347 -999 -999 0 0 0
## 348 -999 -999 0 0 0
## jtwc_.._eye jtwc_.._wrad34_rad1 jtwc_.._wrad34_rad2
## 346 -999 -999 -999
## 347 0 -1 -1
## 348 0 -1 -1
## jtwc_.._wrad34_rad3 jtwc_.._wrad34_rad4 jtwc_.._wrad50_rad1
## 346 -999 -999 -999
## 347 -1 -1 -1
## 348 -1 -1 -1
## jtwc_.._wrad50_rad2 jtwc_.._wrad50_rad3 jtwc_.._wrad50_rad4
## 346 -999 -999 -999
## 347 -1 -1 -1
## 348 -1 -1 -1
## jtwc_.._wrad64_rad1 jtwc_.._wrad64_rad2 jtwc_.._wrad64_rad3
## 346 -999 -999 -999
## 347 -1 -1 -1
## 348 -1 -1 -1
## jtwc_.._wrad64_rad4
## 346 -999
## 347 -1
## 348 -1
ggplot(tracy_loc, aes(x = longitude, y = latitude)) +
geom_path() + geom_point(aes(color = wind.wmo.))
## Warning: Removed 12 rows containing missing values (geom_point).

library(ggmap)
darwin_map <- get_map(location = 'Darwin', zoom = 5)
## Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=Darwin&zoom=5&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Darwin&sensor=false
ggmap(darwin_map) +
geom_path(data = tracy_loc, aes(x = longitude, y = latitude)) +
geom_point(data = tracy_loc, aes(x = longitude, y = latitude,
color = wind.wmo.))
## Warning: Removed 12 rows containing missing values (geom_point).

What cities had problems with flooding during the storm? Get some measure to identify if and to what degree the location flooded.
BG: The waterData package allows you to pull daily hydrologic time series from the USGS. You need to have the station IDs to do that first, though.
The package countyweather (this is Rachel’s package) has a function to pull all the station IDs for a US county, based on the county FIPS code. This function is still in development (so feel free to fork the package and make your own changes!), but for right now you can use it like this– to get the station IDs for Miami-Dade, which has a FIPS code of 12086:
[Change to load from my branch of county weather for the moment because of the streamstations issue.]
# library(devtools)
install_github("geanders/countyweather") # install the package if you need to
## Downloading GitHub repo geanders/countyweather@master
## from URL https://api.github.com/repos/geanders/countyweather/zipball/master
## Installing countyweather
## Skipping 4 packages ahead of CRAN: rgdal, rnoaa, sp, weathermetrics
## '/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file \
## --no-environ --no-save --no-restore CMD INSTALL \
## '/private/var/folders/_n/qp9kh0cj07l440ps5wncks1w0000gn/T/RtmpjvyjS5/devtools28475b8bf3fd/geanders-countyweather-fccef4c' \
## --library='/Library/Frameworks/R.framework/Versions/3.2/Resources/library' \
## --install-tests
##
## Reloading installed countyweather
library(countyweather)
miami_ids <- countyweather:::streamstations("12086",
date_min = "1992-08-20",
date_max = "1992-08-30")
miami_ids
## [1] "02287395" "02287497" "02288600"
## [4] "02289019" "02289040" "02289041"
## [7] "02289050" "02289060" "02289500"
## [10] "02290710" "022907647" "02290765"
## [13] "02290769" "252523080352500" "254543080405401"
## [16] "254543080491101"
Then you can use these IDs with importDVs from the waterData package to import daily hydrological time series data. This function will, I think, only pull for one gauge at a time:
# install.packages(waterData) # if you need to install the package
library(waterData)
miami_1 <- importDVs(miami_ids[1], sdate = "1992-08-20", edate = "1992-08-30")
head(miami_1)
## staid val dates qualcode
## 1 02287395 51 1992-08-20 A
## 2 02287395 54 1992-08-21 A
## 3 02287395 52 1992-08-22 A
## 4 02287395 48 1992-08-23 A
## 5 02287395 77 1992-08-24 A
## 6 02287395 74 1992-08-25 A
ggplot(miami_1, aes(x = dates, y = val)) + geom_line() +
geom_point() + ggtitle("Stream discharge for streamgage 02287395")

The default is for importDVs to pull in the mean daily value. You can use the stat option to change what you get in, although for this, you’d want to look up what all the USGS statistics codes are. You can also change the USGS parameter code using the code argument. The default is “00060”, which is the discharge in cubic feet per second. The help file for importDvs has web links to find the right codes for these.
So, I think next steps would be to use something from the apply family of functions or a loop to go through and get data from all of the Miami gauges, and then plot the discharge for them all. Are there any problems with pulling data from any of the gauges that we get back from the streamflow function?